﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.master" Inherits="System.Web.Mvc.ViewPage<DNA.Models.User>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Create
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Criar</h2>

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>

<% using (Html.BeginForm()) { %>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
    <form runat="server">
        <legend>Usuário</legend>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.Name) %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.Name) %>
            <%: Html.ValidationMessageFor(model => model.Name) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.Lastname) %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.Lastname) %>
            <%: Html.ValidationMessageFor(model => model.Lastname) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.Email) %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.Email) %>
            <%: Html.ValidationMessageFor(model => model.Email) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.Password) %>
        </div>
        <div class="editor-field">
            <%: Html.PasswordFor(model => model.Password) %>
            <%: Html.ValidationMessageFor(model => model.Password) %>
        </div>
        <div class="editor-label">
            <asp:Label ID="lblConfirma" runat="server" Text="Confirma Senha"></asp:Label>
        </div>
        <div class="editor-field">
            <%: Html.PasswordFor(model => model.PasswordConfirmation) %>
            <%: Html.ValidationMessageFor(model => model.PasswordConfirmation) %>
        </div>
        <p>
            <input type="submit" value="Create" />
        </p>
        </form>
    </fieldset>
<% } %>

<div>
<p>Realizar importação de Usuários</p>
<% using (Html.BeginForm("Importar", "User", FormMethod.Post, new { enctype="multipart/form-data"})) { %>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend>Importação de Usuários</legend>

        Realize a importação de usuários através de um arquivo XML.
        <div class="editor-label">
            Arquivo xml de usuários
        </div>
        <div class="editor-field">
            <input type="file" name="Users" />
        </div>

        <p>
            <input type="submit" value="Importar" />
        </p>
    </fieldset>
<% } %>

</div>

<div>
    <%: Html.ActionLink("Voltar", "Index") %>
</div>

</asp:Content>
